import { request } from '../../../utils/request.js'
Page({
    data: {
        bannerList: [],
        issupplier: true, //是否为供货商，不是不能抢单报价
        not_supplier_show: false, //非供货商点击抢单弹框
        message: '您当前不是供货商不能抢单'
    },
    onSearch(e) {

    },
    grabbing_orders() {
        if (this.data.issupplier === false) {
            this.setData({ not_supplier_show: true })
            wx.hideTabBar()
            return
        }
        wx.navigateTo({
            url: '/pages/grabbing_orders/grabbing_orders',
        })
    },
    dialog_confirm() {
        this.setData({ not_supplier_show: false })
        wx.showTabBar();

    },
    onLoad: function() {
        let { host } = getApp().globalData
        this.setData({ host })
        let that = this
        request({
            url: '/home/index/banner?from=index',
            method: 'GET',
            success(data) {
                let bannerList = data.data.data
                that.setData({ bannerList })
            }
        })
    }
})